<li class="constant" id="item_1">
<% fields_for "definition[constants][]", constant do |constant_form| %>
  <%= enable_sorting %>
  <h3>Constant</h3>
    <label>Constant Name</label> <%= constant_form.text_field :constant, :index => nil %>
    <%= constant_form.hidden_field :type, :index => nil,:value => "Constant" %>
    <%= constant_form.hidden_field :pos_num, :index => nil %>
    <p>
    <% if constant.new_record? %>
        <%= link_to_function "remove", "this.up('.constant').remove()" %>
    <% else %>
      <%= link_to_function "remove", "mark_for_destroy(this, '.constant')" %>
      <%= constant_form.hidden_field :id, :index => nil %>
      <%= constant_form.hidden_field :should_destroy,
          :index => nil, :class => "should_destroy"%>
     
    <% end %>
  </p>
<% end %>
</li>
